import { WeaTools } from 'ecCom';
export const newUrl = '/api/cube/batchadd/'
export const CallAPI = (url, method, params) => {
    return new Promise((resolve, reject) => {
        WeaTools.callApi(url, method, params).then(({ noRight, ...data }) => {
            if (noRight) {
                resolve({ noRight, ...data } as any)
            } else {
                resolve(data as any)
            }
        })
    })
}


export const getColumnInfo = (params) => {
    return CallAPI(`${newUrl}getColumnInfo`, "get", params);
}

export const saveDatas = (params) => {
    return CallAPI(`${newUrl}saveDatas`, "post", params);
}
